package com.hzdesk.media.koreabatchmatvector.base;

import android.app.Application;
import android.content.Context;
import android.os.Handler;

import com.hzdesk.media.koreabatchmatvector.bean.MouseUserDevicesinfoBean;
import com.hzdesk.media.koreabatchmatvector.bean.PathBean;
import com.hzdesk.media.koreabatchmatvector.bean.UserBean;
import com.hzdesk.media.koreabatchmatvector.bean.VideoFile;
import com.hzdesk.media.koreabatchmatvector.dao.MouseUserDevicesinfoDaoUtils;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by Administrator on 2018/6/19.
 * 杭州席媒科技有限公司  Developers  刘传华  13
 * 佛祖镇楼 bug辟易
 */

public class MyClientApplication extends Application {

    private static  List<PathBean> mPathBeanList =  new ArrayList<>();           //用户批注集合

    private static long startTime;                                                     //录制开始时间

    private static boolean isRecording = false;                                        //录制控制
    private static boolean isAudio = false;                                            //录制音频控制
    private static boolean isRecordVoice = false;                                      //录制声音控制
    private static boolean isDrawing = false;                                          //绘制控制
    private static boolean isCanDraw=false;                                            //Deskmedia控制
    private static boolean isNetWork=false;                                            //网络控制
    private static String meetingName = "视频批注会议";                                  //会议名称
    private static int userNum = 0;                                                     //记录当前用户编号


    private static VideoFile videoFile;                                                        //当前播放视频

    public static Handler getMhandler() {
        return mhandler;
    }

    private  static  Handler mhandler;

    @Override
    public void onCreate() {
        super.onCreate();
        mhandler = new Handler();
    }


    public static List<MouseUserDevicesinfoBean> getUserBeanList(Context context) {
        MouseUserDevicesinfoDaoUtils mouseUserDevicesinfoDaoUtils=new MouseUserDevicesinfoDaoUtils(context);
        return mouseUserDevicesinfoDaoUtils.queryAll();
    }
    //根据鼠标ID获取MouseUserDevicesinfoBean对象
    public static MouseUserDevicesinfoBean getMouseUserDeviceinfoBean(Context context,int userNum){
        MouseUserDevicesinfoBean mouseUserDevicesinfoBean=new MouseUserDevicesinfoBean();
        List<MouseUserDevicesinfoBean> list=getUserBeanList(context);
        for (MouseUserDevicesinfoBean mouseUserDevicesinfoBean2:list){
            if (mouseUserDevicesinfoBean2.getMouseNum()==userNum){
                mouseUserDevicesinfoBean=mouseUserDevicesinfoBean2;
                break;
            }
        }
        return mouseUserDevicesinfoBean;
    }

    public static void changeMouseUserDevicesinfoBean(Context context,MouseUserDevicesinfoBean bean){
        MouseUserDevicesinfoDaoUtils mouseUserDevicesinfoDaoUtils=new MouseUserDevicesinfoDaoUtils(context);
        mouseUserDevicesinfoDaoUtils.update(bean);
    }
    public static List<PathBean> getmPathBeanList() {
        return mPathBeanList;
    }
    public static void setmPathBeanList(PathBean pathBean) {
        mPathBeanList.add(pathBean);
    }

    public static long getStartTime() {
        return startTime;
    }

    public static void setStartTime(long startTime) {
        MyClientApplication.startTime = startTime;
    }

    public static boolean isRecording() {
        return isRecording;
    }

    public static void setIsRecording(boolean isRecording) {
        MyClientApplication.isRecording = isRecording;
    }

    public static boolean isIsAudio() {
        return isAudio;
    }

    public static void setIsAudio(boolean isAudio) {
        MyClientApplication.isAudio = isAudio;
    }

    public static boolean isIsRecordVoice() {
        return isRecordVoice;
    }

    public static void setIsRecordVoice(boolean isRecordVoice) {
        MyClientApplication.isRecordVoice = isRecordVoice;
    }

    public static boolean isDrawing() {
        return isDrawing;
    }

    public static void setDrawing(boolean isDrawing) {
        MyClientApplication.isDrawing = isDrawing;
    }

    public static boolean isCanDraw() {
        return isCanDraw;
    }

    public static void setIsCanDraw(boolean isCanDraw) {
        MyClientApplication.isCanDraw = isCanDraw;
    }

    public static boolean isIsNetWork() {
        return isNetWork;
    }

    public static void setIsNetWork(boolean isNetWork) {
        MyClientApplication.isNetWork = isNetWork;
    }

    public static String getMeetingName() {
        return meetingName;
    }

    public static void setMeetingName(String meetingName) {
        MyClientApplication.meetingName = meetingName;
    }

    public static int getUserNum() {
        return userNum;
    }

    public static void setUserNum(int userNum) {
        MyClientApplication.userNum = userNum;
    }
    public static VideoFile getVideoFile() {
        return videoFile;
    }

    public static void setVideoFile(VideoFile videoFile) {
        MyClientApplication.videoFile = videoFile;
    }

}
